<?php
/**
 * Created by PhpStorm.
 * User: leo
 * Date: 2018/5/14
 * Time: 13:33
 */
header('Content-Type:application/json');
session_start();
include '../classes/conn.php';
$nums=array();
$names=array();
if(isset($_SESSION['admin_num'])){
    $query="select num,name from teacher";
    $res=mysql_query($query);
    while ($row=mysql_fetch_assoc($res)){
        $nums[]=$row['num'];
        $names[]=$row['name'];
    }
    $data=array('nums'=>$nums,'names'=>$names);
    $data=json_encode($data);
    echo $data;
}
else echo 'no_login';